﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 学生选课及成绩查询管理系统
{
    public partial class ShowStudentCountforClass : Form
    {
        public ShowStudentCountforClass()
        {
            InitializeComponent();
        }

        private void ShowStudentCountforClass_Load(object sender, EventArgs e)
        {
            string sql = "select classname as '班名',class.classno as '班号',count(class.classno) as '班级人数' from class join student on student.classno=class.classno group by class.classno,classname,class.clastate having class.clastate=1";
            DataTable dt = DBAccess.GetTable(sql);
            dataGridView1.DataSource = dt;


        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
